package com.activemq.springtest.listener;

import org.springframework.jms.listener.SessionAwareMessageListener;

import javax.jms.*;

/**
 * 回复监听 bean1.xml
 */
public class TestProducerReplyMessageListener implements SessionAwareMessageListener {

    @Override
    public void onMessage(Message message, Session session) throws JMSException {
        if(message instanceof TextMessage){
            try {
                String text=((TextMessage)message).getText();
                System.out.println("spring中生产者接收的回复消息监听器接收到"+text);
            } catch (JMSException e) {
                e.printStackTrace();
            }
        }
    }
}
